package com.yfq;

import com.yfq.springframework.beans.BeansException;
import com.yfq.springframework.beans.config.BeanPostProcessor;

/**
 * @author: yfq
 * @date: 2023/1/29 17:09
 * @description:
 */
public class MyBeanPostProcessor implements BeanPostProcessor {
    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        System.out.printf("[%s]MyBeanPostProcessor的before方法执行...%n", beanName);

        return BeanPostProcessor.super.postProcessBeforeInitialization(bean, beanName);
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        System.out.printf("[%s]MyBeanPostProcessor的after方法执行...%n", beanName);

        return BeanPostProcessor.super.postProcessAfterInitialization(bean, beanName);
    }
}
